package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.Institution;
import com.ruoyi.system.mapper.InstitutionMapper;
import com.ruoyi.system.service.IInstitutionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class InstitutionServiceImpl implements IInstitutionService {
    @Autowired
    private InstitutionMapper institutionMapper;
    @Override
    public List<Institution> selectAllInstitution(Institution institution) {
        return institutionMapper.selectAllInstitution(institution);
    }

    @Override
    public Institution selectInstitutionById(Long itId) {
        return institutionMapper.selectInstitutionById(itId);
    }

    @Override
    public Institution queryByUid(Long uId) {
        return institutionMapper.queryByUid(uId);
    }

    @Override
    public boolean checkPhoneUnique(Institution institution) {
        return institutionMapper.checkPhoneUnique(institution)==0?true:false;
    }

    @Override
    public boolean addInstitution(Institution institution) {
        return institutionMapper.addInstitution(institution)==1?true:false;
    }

    @Override
    public boolean updateInstitution(Institution institution) {
        return institutionMapper.updateInstitution(institution)==1?true:false;
    }

    @Override
    public boolean removeInstitution(Long itId) {
        return institutionMapper.removeInstitution(itId)==1?true:false;
    }
}
